<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<html >
<head>
    <meta charset="UTF-8">
    <title th:text="#{problem} + ' - ' + ${problem.problem_id}+'.'+${problem.title}"></title>
    <meta http-equiv="keywords" content="ACM,OJ,OnlineJudge,JAVA,C++,HappyOJ,IDE,在线判题系统,在线IDE">
    <meta http-equiv="description" content="Topic of Online Judge System for ACM">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" th:href="@{/css/styles.css}" >
    <link rel="stylesheet" th:href="@{/js/editormd/css/editormd.css}" />
    <link rel="stylesheet" th:href="@{/js/editormd/css/editormd.preview.css}" />
    <script th:src="@{/js/jquery-1.7.2.js}"></script>
    <script th:src="@{/js/gdoj.js}"></script>
    <script type='text/javascript' th:src="@{/js/editormd/lib/marked.min.js}"></script>
    <script type='text/javascript' th:src="@{/js/editormd/lib/prettify.min.js}"></script>
    <script type='text/javascript' th:src="@{/js/editormd/editormd.min.js}"></script>
    <script type='text/javascript' th:src='@{/js/editor-md.js}'></script>
    <script type='text/javascript' th:src="@{/js/messager.js}"></script>
</head>
<style>
    .headerNav {width:100%!important; margin:0px auto; height:40px;font-size:16px;}
    body, html {margin:0!important; height:100%!important; overflow-x:hidden!important;overflow-y:hidden!important}
</style>
<body>
<div th:replace="common::web-navbar"></div>
<div id="problem-box">
        <div id="problem-box-left" >
            <div id="problem-box-nav" class="problem-second-nav">
                <div class="hleft">
                    <div id="problem-box-nav-content" class="nav_menu current">
                        <span><svg viewBox="0 0 1024 1024" p-id="14655" width="14" height="14"><path d="M699.970832 284.404258c-33.864006 0.585123-61.94992-24.867737-62.900745-56.903233V35.873173a15.871467 15.871467 0 0 1 10.385937-13.823536 16.822292 16.822292 0 0 1 17.553696 3.291318l257.746776 233.683583a14.042957 14.042957 0 0 1 3.364459 16.31031 15.798327 15.798327 0 0 1-14.993783 8.923129H699.970832v0.146281z m0 56.830092h217.885257c8.557427-0.146281 16.822292 2.925616 22.892946 8.338006a29.987565 29.987565 0 0 1 9.873954 21.210716v538.386497a113.367623 113.367623 0 0 1-37.667307 81.478408 126.532895 126.532895 0 0 1-87.549061 32.401198H198.520238a126.825457 126.825457 0 0 1-87.549061-32.401198 113.367623 113.367623 0 0 1-37.667306-81.478408V113.913981A113.367623 113.367623 0 0 1 110.971177 32.435574 126.532895 126.532895 0 0 1 198.520238 0.107516h342.516501c18.2851-0.292562 33.352023 13.384694 33.644585 30.645829v196.6014c1.535948 64.363554 57.561496 115.196133 125.216368 113.879605zM261.274703 852.85146h501.377454a30.206986 30.206986 0 0 0 31.450372-28.524757 30.206986 30.206986 0 0 0-31.450372-28.451616H261.347843a30.206986 30.206986 0 0 0-31.450372 28.524757c0.438842 16.017748 14.4818 28.744178 31.450372 28.451616z m0-170.782838h501.377454a32.108636 32.108636 0 0 0 21.94212-8.045444 28.159055 28.159055 0 0 0 9.508252-20.479313 29.841284 29.841284 0 0 0-31.450372-28.159054H261.347843a29.841284 29.841284 0 0 0-31.450372 28.232195 28.159055 28.159055 0 0 0 9.508252 20.333031 31.816075 31.816075 0 0 0 21.94212 8.045445z m0-170.417136H574.900745a30.206986 30.206986 0 0 0 31.450373-28.378476 30.206986 30.206986 0 0 0-31.450373-28.524757H261.347843a30.206986 30.206986 0 0 0-31.450372 28.524757c0.438842 16.017748 14.4818 28.744178 31.450372 28.451616z" fill="#7FA5FF" p-id="14656"></path></svg>
                        [[#{problem.description}]]
                        </span>
                    </div>
                    <div id="problem-box-nav-editorial" class="nav_menu">
                        <span>
                            <svg viewBox="0 0 1210 1024" p-id="24955" width="14" height="14"><path d="M186.181818 0h837.818182a186.181818 186.181818 0 0 1 186.181818 186.181818v651.636364a186.181818 186.181818 0 0 1-186.181818 186.181818H186.181818a186.181818 186.181818 0 0 1-186.181818-186.181818V186.181818a186.181818 186.181818 0 0 1 186.181818-186.181818z m561.384727 652.520727l-23.784727 1.163637c9.309091 0 17.175273 0.186182 23.784727-1.163637z m0-1.489454l35.048728-0.279273 0.279272-41.239273c-0.698182 34.909091-5.352727 40.587636-35.328 41.518546z m-369.198545 1.582545c5.818182 0.930909 12.474182 0.977455 20.061091 0.977455l-20.061091-0.930909z m452.514909-401.687273l-20.107636-0.930909c7.633455 0 14.289455 0.046545 20.107636 0.930909z m11.170909 79.685819c-4.747636-28.578909-28.206545-50.408727-56.645818-51.2l-452.514909 0.232727c-29.509818 2.932364-52.689455 28.392727-53.620364 59.764364l0.232728 317.579636c2.792727 31.511273 28.113455 56.133818 58.97309 56.133818h31.464728v0.186182l57.483636-0.093091 0.186182 84.107636a32.023273 32.023273 0 0 0 7.261091 31.418182c11.543273 12.101818 30.301091 12.101818 41.890909 0l111.104-115.339636 164.398545-0.186182v-0.093091h31.464728c29.649455 0 54.225455-22.807273 58.554181-52.549818l-0.186181-128.884364a32.674909 32.674909 0 0 0 0.232727-3.723636l-0.232727-197.352727zM338.571636 341.643636h18.152728l-18.013091 0.093091-0.139637 21.131637V341.643636z m444.462546 256.186182l-0.093091 11.636364 0.093091-5.818182 0.046545 47.569455-205.870545 0.232727a29.323636 29.323636 0 0 0-27.182546 13.963636l-63.301818 65.675637-0.046545-43.892364a32.581818 32.581818 0 0 0-0.325818-11.776 30.114909 30.114909 0 0 0-29.323637-26.624 28.392727 28.392727 0 0 0-11.496727 2.420364l-106.728727 0.186181v-0.651636l39.563636 0.279273c-30.906182-0.651636-37.981091-4.747636-39.563636-28.718546l-0.232728-244.829091c1.163636-28.858182 6.981818-34.722909 37.096728-35.84l359.796363-0.232727 8.890182 0.046546-3.258182-0.046546h41.797818l0.046546 45.056-0.279273-44.683636-38.306909-0.325818c32.907636 0.884364 37.934545 6.702545 38.632727 46.08l0.093091 104.494545a32.674909 32.674909 0 0 0-0.232727 3.770182l0.186182 102.027636z m147.688727-361.844363c-5.492364-28.253091-29.416727-49.570909-58.088727-49.57091h-31.464727V186.181818l-354.024728 0.232727c-16.384 0-29.602909 13.870545-29.602909 30.999273 0 17.128727 13.218909 30.999273 29.602909 30.999273l384.325818-0.279273 0.232728 248.552727c0 17.128727 13.265455 30.999273 29.649454 30.999273 16.337455 0 29.602909-13.870545 29.602909-30.952727l-0.232727-260.747636z m-99.793454 12.567272c33.233455 0.698182 38.958545 5.352727 39.889454 34.350546l-0.186182-34.117818-39.703272-0.279273z m42.542545 61.765818c0-10.984727 0.465455-20.014545-1.163636-27.461818l1.163636 27.461818z" fill="#66c4f6" p-id="24956"></path></svg>
                            [[#{problem.editorial}]]
                        </span>
                    </div>
                    <div id="problem-box-nav-status" class="nav_menu">
                        <span class="problem-box-nav-status" >
                            <svg viewBox="0 0 1024 1024" p-id="23675" width="14" height="14"><path d="M849.170732 0c97.404878 0 174.829268 77.42439 174.829268 174.829268v674.341464c0 97.404878-77.42439 174.829268-174.829268 174.829268H174.829268c-97.404878 0-174.829268-77.42439-174.829268-174.829268V174.829268c0-97.404878 77.42439-174.829268 174.829268-174.829268h674.341464zM499.512195 252.253659C349.658537 252.253659 227.278049 374.634146 227.278049 524.487805S349.658537 796.721951 499.512195 796.721951c137.365854 0 252.253659-102.4 269.736585-239.765853l-62.439024-7.492683v4.995122c-14.985366 102.4-102.4 177.326829-204.8 177.326829-114.887805 0-207.297561-92.409756-207.297561-207.297561s92.409756-207.297561 207.297561-207.297561c59.941463 0 117.385366 27.473171 157.346342 72.429268L621.892683 424.585366l147.356097 34.965854-34.965853-147.356098-32.468293 32.468293c-49.95122-57.443902-124.878049-92.409756-202.302439-92.409756z m32.468293 127.375609h-64.936586v177.32683l127.37561 72.429268 32.468293-54.946342-94.907317-54.946341v-139.863415z" fill="#66c4f6" p-id="23676"></path></svg>
                            [[#{problem.mysubmit}]]
                        </span>
                    </div>
                </div>
                <div class="hright">
                    <div class="nav_menu">
                        <span class="ide-menu-item problem-info-close" th:title="#{ide.fold_left}">
                            <img class="ide-menu-img" src="/img/left.png" />
                        </span>
                    </div>
                </div>
            </div>
            <div id="problem-content" class="problem-content small-scrollbar">
                <div id="problem-status" class="problem-status">
                    <div class="" style="">
                        <div class="roundbox-title ">
                            <div class="left"><span th:text="${problem.problem_id}+'.'+${problem.title}"></span></div>
                            <div class="right">
                                <span><a style="margin-right: 6px;font-weight: normal;font-size:12px;color:grey;text-decoration:none;" th:href="@{/problemset/{problemId}/status(problemId=${problem.problem_id})} + '/page/1'">[[#{problem.all_submit}]]</a></span>
                            </div>
                        </div>
                        <div class="" style="">
                            <table class="status">
                                <tr class="header">
                                    <th  class="verdict left-item">[[#{status}]]</th>
                                    <th  class="time">[[#{timeuse}]]</th>
                                    <th  class="memory">[[#{memoryuse}]]</th>
                                    <th  class="language">[[#{language}]]</th>
                                    <th  class="date">[[#{submitdate}]]</th>
                                </tr>
                            </table>
                        </div>
                        <div id="problem-status-loader" class="problem-status-loader"><img th:src='@{/img/loader.gif}'></div>
                    </div>
                </div>
                <div id="problem-information" class="problem-information">
                    <div class="data-title">
                        <h2 th:text="${problem.problem_id}+'.'+${problem.title}"></h2>
                        <span class="problem-tips" th:text="#{problem.time_limit} + ':' + ${problem.time_limit} + 'MS&nbsp;&nbsp;' + #{problem.memory_limit} + ':' + ${problem.memory_limit} + 'KB'"></span>
                        <br/>
                    </div>
                    <div class="probleminfo" style="padding:0px 0px 12px 0px;">
                        <h5 th:text="#{problem.description}">:</h5>
                        <div class="content markdown-view" id="problem-description-markdown-view">
                            <textarea style="display:none;" th:utext="${problem.description}"></textarea>
                        </div>
                        <h5 th:text="#{problem.input}">:</h5>
                        <div class="content markdown-view" id="problem-input-markdown-view">
                            <textarea style="display:none;" th:utext="${problem.input}"></textarea>
                        </div>
                        <h5 th:text="#{problem.output}">:</h5>
                        <div class="content markdown-view" id="problem-output-markdown-view">
                            <textarea style="display:none;" th:utext="${problem.output}"></textarea>
                        </div>
                        <h5 th:text="#{problem.sample_test}">:</h5>
                        <div class="sample-test">
                            <div class="input"><div class="title">[[#{problem.sample_input}]]</div>
                                <div class="sample-input"><pre th:utext="${problem.sample_input}"></pre></div>
                            </div>
                            <div class="output"><div class="title">[[#{problem.sample_output}]]</div>
                                <div class="sample-output"><pre th:utext="${problem.sample_output}"></pre></div>
                            </div>
                        </div>
                        <h5 th:text="#{problem.note}"></h5>
                        <div th:if="${#strings.length(problem.hint)} > 10" class="content markdown-view" id="problem-hint-markdown-view">
                            <textarea style="display:none;" th:utext="${problem.hint}"></textarea>
                        </div>
                        <h5 th:text="#{problem.tags}"></h5>
                        <div class="tags" th:if="${problem.tags.size > 0}">
                            <span th:each="tag : ${problem.tags}">
                                 <a th:href="'/problemset?tag=' + ${tag.name}" class="tag" th:tag="${tag.name}" th:text="${tag.name}"></a>
                            </span>
                        </div>
                    </div>
                </div>
                <div id="problem-editorial" class="problem-editorial">
                    <div class="problem-editorial-tool">
                        <a class="submit-button problem-editorial-submit" th:href="@{/problem/{problem_id}/editorial/new(problem_id=${problem.problem_id})}">
                            <svg class="icon-svg" viewBox="0 0 1024 1024" p-id="12750"><path d="M639.613606 0.587107v63.236333H247.417277c-48.430677 0-126.104062-9.686135-155.203424 11.938725C51.749153 105.823998 64.527479 200.166546 64.527479 269.095788v476.156487c0 52.915378-10.013785 153.810914 13.228845 183.770356 28.423585 36.635298 132.738962 22.669243 196.098164 22.669243H765.901971c65.73466 0 151.537846 11.119601 180.452905-26.252908 22.525896-29.01745 13.228844-104.438245 13.228845-153.954261V381.274751h63.768764v392.60589c0 68.806373 5.897689 143.141831-21.645338 183.770356-44.683187 65.918963-122.970915 57.338645-232.201033 57.338645H276.29138c-92.847648 0-181.005814 10.239044-233.450195-31.024303-51.973386-40.956175-42.102948-135.155376-42.102948-227.94159V252.385669c0-99.380158-9.071793-178.998961 48.123505-223.211152 45.809481-35.365657 111.544142-28.669322 192.494021-28.669323h398.257843z m170.807727 31.024302a77.161433 77.161433 0 0 1 40.956174 10.750996l131.059759 131.26454a71.980477 71.980477 0 0 1-2.395936 69.215935l-204.514658 202.876411-305.57402 303.075693-25.269959 8.35506-58.956414 28.669322L204.106122 876.557771c-16.38247 8.191235-49.14741 31.413386-70.97705 16.710119-23.856972-16.013864-8.375538-50.53992 1.208207-69.215935l97.455218-195.709081 27.665896-52.505816 9.624701-27.440637L615.551853 204.651247 780.379979 41.051807a77.530039 77.530039 0 0 1 30.041354-9.460876z m-16.81251 84.717847l-66.1647 65.652748 7.228765 7.146853 102.267568 106.219839 70.977051-69.195457a41.160956 41.160956 0 0 0 4.81235-31.024302c-5.201434-13.433625-51.195218-54.266931-76.997608-79.864541a31.884382 31.884382 0 0 0-42.123426 1.06486z m-115.496413 113.366692l-356.113939 355.642943 110.581672 110.991233 359.820473-355.642943-66.1647-66.819999z m-392.216807 411.609556l-86.622309 142.117926c-7.208287 11.67251-29.488446 39.973227-8.416494 50.10988 20.478087 5.713386 40.014183-15.993386 52.935856-23.87745l133.537607-78.758724z" fill="#ffffff" p-id="12751"></path></svg>
                            [[#{problem.editorial-post}]]
                        </a>
                        <div class="problem-editorial-tool-tips"><span class="problem-editorial-num"></span> [[#{problem.editorials}]]</div>
                    </div>
                    <div class="problem-editorial-list">
                    </div>
                </div>
            </div>
            <div id="bottom-bar-left">
                <div class="bottom_button"></div>
            </div>
        </div>
        <div id="problem-drag-bar" class="gutter gutter-horizontal"></div>
        <div id="problem-box-right">
            <div id="ide-box-nav" class="ide-second-nav">
                <div class="ide-box-nav-left">
                    <input type="hidden" id="username" name="username" th:value="${session.session_username}"/>
                    <input type="hidden" id="contestId" name="contestId" value="0"/>
                    <input type="hidden" id="problemId" name="problemId" th:value="${problem.problem_id}">
                    <div>
                        <select class="lang-choice" id="select_lang" name="language" th:if="${languages==null}">
                            <option value="1" >MS C++</option>
                            <option value="2" >MS C</option>
                            <option value="3" >GNU C++</option>
                            <option value="4" >GNU C</option>
                            <option value="5" >Java</option>
                            <option value="8" >Pascal</option>
                        </select>
                        <select class="lang-choice" id="select_lang" name="language" th:if="${languages!=null}">
                            <option th:each="language,stat : ${languages}"
                                th:value="${language.id}"
                                th:text="${language.language_name}">
                        </select>
                    </div>
                    <span th:if="${session.session_username == null}" style="margin-left: 12px;font-size: 12px;color: grey;cursor:not-allowed">
                        <img th:src="@{/img/warnning.png}" style="width:24px;height:24px;">
                        [[#{problem.submit_login_tip}]]
                    </span>
                </div>
                <div class="ide-box-nav-right">
                    <span class="ide-menu-item load-default-template" th:title="#{ide.reset_default_code_template}">
                        <img class="ide-menu-img" src="/img/default_code.png" />
                    </span>
                    <span class="ide-menu-item ide-setting " th:title="#{ide.setting}">
                        <img class="ide-menu-img" src="/img/ide_setting.png" />
                    </span>
                    <span class="ide-menu-item source-box-close" th:title="#{ide.fold_right}">
                        <img class="ide-menu-img" src="/img/right.png" />
                    </span>
                </div>
            </div>
            <div id="ide-box" class="ide-box">
                <div id="source" class="source-box"></div>
                <div id="test-box">
                    <div id="test-box-nav">
                        <div id="test-nav-tab-input" class="test-box-nav-tab test-box-nav-tab-cur">[[#{problem.testbox.input}]]</div>
                        <div id="test-nav-tab-output" class="test-box-nav-tab">[[#{problem.testbox.output}]]</div>
                    </div>
                    <table class="test-box-tb">
                        <tr id="test-box-tb-input" >
                            <td><textarea id="input" class="test-box-input small-scrollbar" name="input" rows="10">[[${problem.sample_input}]]</textarea></td>
                        </tr>
                        <tr id="test-box-tb-output" style="display:none">
                            <td>
                                <span id="output-status" class="test-box-output-status" th:text="#{problem.testbox.running_code}"></span><br>
                                <textarea id="output" class="test-box-output small-scrollbar" name="output" rows="10"readonly="readonly"></textarea></td>
                        </tr>
                    </table>
                </div>
            </div>
            <div id="bottom-bar-right">
                <div id="consoleMenu" class="console-menu">[[#{problem.console}]]<span id="consoleCaert" class="caret-down"></span></div>
                <div class="bottom_button">
                    <input id="runsolution" class="run-solution button_submit" type="submit" th:value="#{submit.run}"/>
                    <input id="submitsolution" class="submit-solution button_submit" type="submit" th:value="#{submit.submit}"/>
                    <input id="verify-problem" class="verify-problem button_submit" type="submit" th:value="#{submit.verify}"/>
                </div>
            </div>
        </div>
</div>
<script th:src="@{/js/monaco-editor/min/vs/loader.js}"></script>
<script type="text/javascript" th:inline="javascript" th:src="@{/js/submit.js}"></script>
<script type="text/javascript" th:inline="javascript" th:src="@{/js/role.js}"></script>
<link rel="stylesheet" th:href="@{/js/poshytip/tip-whitesimple/tip-whitesimple.css}" type="text/css" />
<script type="text/javascript" th:src="@{/js/poshytip/jquery.poshytip.js}"></script>
<script type="text/javascript" th:src="@{/js/scrolltotop.js}"></script>
<div th:include="problem/ide-setting"></div>
<div th:include="problem/status-pop"></div>

<script type="text/javascript">
    $(document).ready(function () {
        OnlineJudge.userTip();
        OnlineJudge.tagTip();
        OnlineJudge.prettyTitle();
        var username = document.getElementById('username').value;
        if (username.length == 0) {
            $('#submitsolution').attr('disabled', 'disabled');
            $("#submitsolution").css("cursor","not-allowed");
        }
    });
</script>
</body>
</html>
